<?php
/**
 * jishupu-cms
 * @Author:技术铺<jishupu@qq.com>
 * @Date: 2021/11/20
 */

namespace App\Http\Controllers;

use App\Services\CacheService;
use App\Services\RedisService;

/**
 * 缓存模块
 * Class CacheController
 * @package App\Http\Controllers
 */
class CacheController extends Controller
{

    /**
     * 清除所有缓存
     * @return \Illuminate\Http\JsonResponse
     */
    public function clear()
    {
        // 清除前后台公共缓存
        CacheService::clear();
        // 通知：更新前台路由缓存
        RedisService::publishUpdateWebsiteRouteCache();
        return $this->success(__('common.cleared'));
    }
}
